import rpa_login, pdf_download, pdf_download_byDate, ini_op
from playwright.sync_api import sync_playwright
from playwright._impl._api_types import Error


def run(type, *args):
    dwbh = ini_op.getinivalue('basic_config', 'dwbh')[0]
    with sync_playwright() as playwright:
        llq = rpa_login.run(playwright, 'now_browser', 'new_context', 'new_page')
        if type == '联合打印':
            if args[0] == 'excel':
                fileList = args[1]
                pdf_download.run(llq, dwbh, fileList)
            elif args[0] == 'config':
                id = args[1]
                pdf_download_byDate.run(llq, dwbh, id)




        